<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="../css/common.css" />
<script src="../js/common/jquery.js"></script>
<script src="../js/common/drag.js"></script>
<script src="../js/common/angular.min.js"></script>
<script type="text/javascript" src="../js/common/common.js"></script>
<script type="text/javascript" src="../js/directive/ng-switch.js"></script>
<style type="text/css">
    li{
        float: left;
        margin-right:5px;
    }
    .myTab{
        float:left;
        width: 100%;
    }
</style>
</head>
<body ng-app="myApp">

<div class="dqwz">
    <span>当前位置：</span>
    <span>ng-switch</span>
</div>

<section>
    <div ng-controller="myCtrl">
        <h3>【tab切换】</h3>
        <div>
            <ul>
                <li ng-click="myTab_1()">第一个</li>
                <li ng-click="myTab_2()">第二个</li>
                <li ng-click="myTab_3()">第三个</li>
            </ul>
        </div>
        <div ng-switch="myTab" class="myTab">
            <p ng-switch-when="myTab1">111</p>
            <p ng-switch-when="myTab2">222</p>
            <p ng-switch-when="myTab3">333</p>
            <p ng-switch-default>这是默认的</p>
        </div>
        <!-- 查看源码开始 -->
        <div class="htmlCode">
            <span>【html源码】</span>
            <xmp ng-non-bindable>
<div>
    <ul>
        <li ng-click="myTab_1()">第一个</li>
        <li ng-click="myTab_2()">第二个</li>
        <li ng-click="myTab_3()">第三个</li>
    </ul>
</div>
<div ng-switch="myTab" class="myTab">
    <p ng-switch-when="myTab1">111</p>
    <p ng-switch-when="myTab2">222</p>
    <p ng-switch-when="myTab3">333</p>
    <p ng-switch-default>这是默认的</p>
</div>
            </xmp>
            <span>【css源码】</span>
            <xmp ng-non-bindable>
li{
    float: left;
    margin-right:5px;
}
.myTab{
    float:left;
    width: 100%;
}
            </xmp>
            <span>【js源码】</span>
            <xmp>
app.controller('myCtrl',function($scope){
    $scope.myTab_1 = function(){
        $scope.myTab = 'myTab1';
    }
    $scope.myTab_2 = function(){
        $scope.myTab = 'myTab2';
    }
    $scope.myTab_3 = function(){
        $scope.myTab = 'myTab3';
    }
})
            </xmp>
            <span class="close"><a href="javascript:;">关闭</a></span>
        </div>
        <div class="viewCode">
            <span><a href="javascript:;"> >>查看源码</a></span>
        </div>
        <!-- 查看源码结束 -->
    </div>
</section>

<div class="mask_layer">
</div>

</body>
</html>